﻿@{
    ViewBag.Title = "DictionaryTypeTree";
}
@section head
{
    <script src="@Url.Content("~/ScriptPlugin/ztree/js/jquery.ztree.core-3.5.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/ScriptPlugin/ztree/css/zTreeStyle/zTreeStyle.css")" rel="stylesheet" type="text/css" />
}
@model string
<div>
    <ul id="tree" class="ztree"></ul>
</div>
@section foot
{
    <script type="text/javascript">
        var jsonTree = @MvcHtmlString.Create(Model);
        var zTree = $.fn.zTree.init($("#tree"), {}, jsonTree);
        function SaveData(index)
        {
            var nodes = zTree.getSelectedNodes();
            if(nodes.length==0)
            {
                KingsSharp.Alert("请选择！");
            }
            if(!nodes[0].isRoot)
            {
                parent.K.layer.callback(index,nodes[0]);
                parent.K.layer.close(index);
            }
            else
            {
                K.Alert("不能选择根目录！")
            }
        }
    </script>
}